public class Demo19 {
    public static Object loke1 = new Object();
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            synchronized (loke1){
                System.out.println("t1线程等待");
                try {
                    loke1.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("t1线程被唤醒");
        });
        Thread t2 = new Thread(()->{
            synchronized (loke1){
                System.out.println("t2线程等待");
                try {
                    loke1.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("t2线程被唤醒");
        });
        Thread t3 = new Thread(()->{
            synchronized (loke1){
                System.out.println("t3线程等待");
                try {
                    loke1.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("t3线程被唤醒");
        });
        Thread t4 = new Thread(()->{
            synchronized (loke1){
                loke1.notify();
            }
        });
        t1.start();
        t2.start();
        t3.start();
        t4.start();
    }
}

